#ifndef __ROM_RTW_DEFS_H_
#define __ROM_RTW_DEFS_H_

/**
  * @brief  The enumeration lists all the network mode.
  */
enum wlan_mode {
	WLAN_MD_INVALID = 0,
	WLAN_MD_11B	= BIT0,
	WLAN_MD_11A	= BIT1,
	WLAN_MD_11G	= BIT2,
	WLAN_MD_11N	= BIT3,
	WLAN_MD_11AC	= BIT4,
	WLAN_MD_11AX	= BIT5,

	/* Type for current wireless mode */
	WLAN_MD_11BG	= (WLAN_MD_11B | WLAN_MD_11G),
	WLAN_MD_11GN	= (WLAN_MD_11G | WLAN_MD_11N),
	WLAN_MD_11AN	= (WLAN_MD_11A | WLAN_MD_11N),
	WLAN_MD_11BN	= (WLAN_MD_11B | WLAN_MD_11N),
	WLAN_MD_11BGN	= (WLAN_MD_11B | WLAN_MD_11G | WLAN_MD_11N),
	WLAN_MD_11BGAC = (WLAN_MD_11B | WLAN_MD_11G | WLAN_MD_11AC),
	WLAN_MD_11BGAX = (WLAN_MD_11B | WLAN_MD_11G | WLAN_MD_11AX),
	WLAN_MD_11GAC  = (WLAN_MD_11G | WLAN_MD_11AC),
	WLAN_MD_11GAX  = (WLAN_MD_11G | WLAN_MD_11AX),
	WLAN_MD_11A_AC = (WLAN_MD_11A | WLAN_MD_11AC),
	WLAN_MD_11A_AX = (WLAN_MD_11A | WLAN_MD_11AX),

	/* Capability -Type for registry default wireless mode */
	WLAN_MD_11AGN	= (WLAN_MD_11A | WLAN_MD_11G | WLAN_MD_11N),
	WLAN_MD_11ABGN	= (WLAN_MD_11A | WLAN_MD_11B | WLAN_MD_11G | WLAN_MD_11N),
	WLAN_MD_11ANAC	= (WLAN_MD_11A | WLAN_MD_11N | WLAN_MD_11AC),
	WLAN_MD_11BGNAC = (WLAN_MD_11B | WLAN_MD_11G | WLAN_MD_11N | WLAN_MD_11AC),
	WLAN_MD_11GNAC  = (WLAN_MD_11G | WLAN_MD_11N | WLAN_MD_11AC),
	WLAN_MD_24G_MIX = (WLAN_MD_11B | WLAN_MD_11G | WLAN_MD_11N  | WLAN_MD_11AX),
	WLAN_MD_5G_MIX	= (WLAN_MD_11A | WLAN_MD_11N | WLAN_MD_11AC | WLAN_MD_11AX),
	WLAN_MD_6G_MIX 	= (WLAN_MD_11A | WLAN_MD_11AX),
	WLAN_MD_MAX	= (WLAN_MD_24G_MIX | WLAN_MD_5G_MIX),
};

typedef enum _RT_CHANNEL_DOMAIN_2G {
	RTW_RD_2G_NULL = 0,	/* Do not support 2G*/
	RTW_RD_2G_01 = 1,	/* Worldwide 13, Canada */
	RTW_RD_2G_02 = 2,	/* Europe, Japan */
	RTW_RD_2G_03 = 3,		/* Worldwide 11, US, Canada, Korea */
	RTW_RD_2G_04 = 4,		/* Japan */
	RTW_RD_2G_05 = 5,	/* France */
	RTW_RD_2G_06 = 6,	/* 2G Global, include channel 14 */
	//===== Add new channel plan above this line===============//
	RT_CHANNEL_DOMAIN_2G_MAX,
} RT_CHANNEL_DOMAIN_2G, *PRT_CHANNEL_DOMAIN_2G;

typedef enum _RT_CHANNEL_DOMAIN_5G {
	RTW_RD_5G_NULL = 0,		/*Do not support 5G*/
	RTW_RD_5G_01 = 1,		/*US, Canada, Australia, New Zealand, Mexico (w/o Weather radar), (w/o Ch120~Ch128)*/
	RTW_RD_5G_02 = 2,		/*Europe, Japan (W52, W53, W56)*/
	RTW_RD_5G_03 = 3,		/*Australia, New Zealand, US, Korea*/
	RTW_RD_5G_04 = 4,		/*Russia (w/o Ch136, Ch140)*/
	RTW_RD_5G_05 = 5,		/*Korea*/
	RTW_RD_5G_06 = 6,		/*FCC w/o DFS Channels, Jordan*/
	RTW_RD_5G_07 = 7,		/*Bolivia, Chile, El Salvador, Venezuela, China */
	RTW_RD_5G_08 = 8,		/*Venezuela, Indonesia (w/o Ch165)*/
	RTW_RD_5G_09 = 9,		/*China, Taiwan w/o DFS, Qatar*/
	RTW_RD_5G_10 = 10,		/*Japan (W52, W53), Israel, Bahrain, Egypt, India, China, Malaysia*/
	RTW_RD_5G_11 = 11,		/*Japan (W56)*/
	RTW_RD_5G_12 = 12,		/*Taiwan, (w/o Weather radar)(w/o Ch52, Ch120~Ch128)*/
	RTW_RD_5G_13 = 13,		/*Taiwan, Band2, Band4*/
	RTW_RD_5G_14 = 14,		/*Europe, Japan (W52), w/o DFS, Band1 only*/
	RTW_RD_5G_15 = 15,		/*Latin America, Indonesia*/
	RTW_RD_5G_16 = 16,		/*Lebanon*/
	RTW_RD_5G_17 = 17,		/*Russia*/
	RTW_RD_5G_18 = 18,		/*Taiwan (w/o Weather radar)(w/o Ch120~Ch128)*/
	RTW_RD_5G_19 = 19,		/*ETSI, FCC (w/o Weather radar)(w/o Ch120~Ch128)*/
	RTW_RD_5G_20 = 20,		/*Argentina(w/o Weather radar)(w/o Ch120~Ch128, Ch165)*/
	RTW_RD_5G_21 = 21,		/*Russia*/
	RTW_RD_5G_22 = 22,		/*US (include Ch144), Chile, Korea (2018 Dec 05 New standard, include ch144)*/
	RTW_RD_5G_23 = 23,		/*Malaysia*/
	RTW_RD_5G_24 = 24,		/*Japan, Europe*/
	RTW_RD_5G_25 = 25,		/*Europe, FCC*/
	RTW_RD_5G_26 = 26,		/*FCC*/
	RTW_RD_5G_27 = 27,		/*FCC w/o Weather radar(w/o Ch120~Ch128)*/
	RTW_RD_5G_28 = 28,		/*FCC w/o Band3 China*/
	RTW_RD_5G_29 = 29,		/*FCC w/o Band3*/
	RTW_RD_5G_30 = 30,		/*ETSI w/o DFS Band2&3*/
	RTW_RD_5G_31 = 31,		/*Europe*/
	RTW_RD_5G_32 = 32,		/*Europe*/
	RTW_RD_5G_33 = 33,		/*Canada (w/o Weather radar)(w/o Ch120~Ch128, include Ch144)*/
	RTW_RD_5G_34 = 34,		/*Australia, New Zealand (w/o Weather radar)(w/o Ch120~Ch128)*/
	RTW_RD_5G_35 = 35,		/**/
	RTW_RD_5G_36 = 36,		/*5G Worldwide (include Ch144) Band2&3 w/i DFS for AP mode.*/
	RTW_RD_5G_37 = 37,		/*5G Worldwide Band1&2*/
	RTW_RD_5G_38 = 38,		/*Chile (Band2,Band3)*/
	RTW_RD_5G_39 = 39,		/*Japan*/
	RTW_RD_5G_40 = 40,		/*Japan*/
	RTW_RD_5G_41 = 41,		/*Japan*/
	RTW_RD_5G_42 = 42,		/*Europe*/
	RTW_RD_5G_43 = 43,		/*Japan, FCC*/
	RTW_RD_5G_44 = 44,		/*FCC*/
	RTW_RD_5G_45 = 45,		/*FCC w/o Band3*/
	RTW_RD_5G_46 = 46,		/*Indonesia*/
	RTW_RD_5G_47 = 47,		/*Japan, Singapore*/
	RTW_RD_5G_48 = 48,		/*Japan*/
	RTW_RD_5G_49 = 49,		/**/
	RTW_RD_5G_50 = 50,		/*Russia*/
	RTW_RD_5G_51 = 51,		/*Tunisia*/
	RTW_RD_5G_52 = 52,		/*US (include Ch144)(2018 Dec 05 New standard, include ch144)Add FCC 5.9G Channel*/
	RTW_RD_5G_53 = 53,		/*Korea*/
	RTW_RD_5G_54 = 54,
	//===== Add new channel plan above this line===============//
	RT_CHANNEL_DOMAIN_5G_MAX
} RT_CHANNEL_DOMAIN_5G, *PRT_CHANNEL_DOMAIN_5G;

// Tx Power Limit Table Size
typedef enum _REGULATION_TXPWR_LMT {
	TXPWR_LMT_FCC = 0,
	TXPWR_LMT_MKK = 1,
	TXPWR_LMT_ETSI = 2,
	TXPWR_LMT_IC = 3,
	TXPWR_LMT_KCC = 4,
	TXPWR_LMT_ACMA = 5,
	TXPWR_LMT_CHILE = 6,
	TXPWR_LMT_MEXICO = 7,
	TXPWR_LMT_WW = 8, // WW13, The mininum of ETSI,MKK
	TXPWR_LMT_GL = 9, // Global, The mininum of all
	TXPWR_LMT_UKRAINE = 10,
	TXPWR_LMT_CN = 11,
	TXPWR_LMT_QATAR = 12,
	TXPWR_LMT_UK = 13,
	TXPWR_LMT_NCC = 14,
	TXPWR_LMT_EXT = 15, /* Customer Customization */
	TXPWR_LMT_NA = 16,  /* Not support, choose NA */
} REGULATION_TXPWR_LMT;

#define TXPWR_LMT_MAX_REGULATION_NUM  TXPWR_LMT_NA

//
// Channel Plan Type.
// Note:
//	We just add new channel plan when the new channel plan is different from any of the following
//	channel plan.
//	If you just wnat to customize the acitions(scan period or join actions) about one of the channel plan,
//	customize them in RT_CHANNEL_INFO in the RT_CHANNEL_LIST.
//
typedef enum _RT_CHANNEL_DOMAIN {
	//===== new channel plan mapping, (2GDOMAIN_5GDOMAIN) =====//
	RT_CHANNEL_DOMAIN_WORLD_NULL = 0x20,
	RT_CHANNEL_DOMAIN_ETSI1_NULL = 0x21,
	RT_CHANNEL_DOMAIN_FCC1_NULL = 0x22,
	RT_CHANNEL_DOMAIN_MKK1_NULL = 0x23,
	RT_CHANNEL_DOMAIN_ETSI2_NULL = 0x24,
	RT_CHANNEL_DOMAIN_FCC1_FCC1 = 0x25,
	RT_CHANNEL_DOMAIN_WORLD_ETSI1 = 0x26,
	RT_CHANNEL_DOMAIN_MKK1_MKK1 = 0x27,
	RT_CHANNEL_DOMAIN_WORLD_KCC1 = 0x28,
	RT_CHANNEL_DOMAIN_WORLD_FCC2 = 0x29,
	RT_CHANNEL_DOMAIN_FCC2_NULL = 0x2A,
	RT_CHANNEL_DOMAIN_IC1_IC2 = 0x2B,
	RT_CHANNEL_DOMAIN_MKK2_NULL = 0x2C,
	RT_CHANNEL_DOMAIN_WORLD_CHILE1 = 0x2D,
	RT_CHANNEL_DOMAIN_WORLD1_WORLD1 = 0x2E,
	RT_CHANNEL_DOMAIN_WORLD_CHILE2 = 0x2F,
	RT_CHANNEL_DOMAIN_WORLD_FCC3 = 0x30,
	RT_CHANNEL_DOMAIN_WORLD_FCC4 = 0x31,
	RT_CHANNEL_DOMAIN_WORLD_FCC5 = 0x32,
	RT_CHANNEL_DOMAIN_WORLD_FCC6 = 0x33,
	RT_CHANNEL_DOMAIN_FCC1_FCC7 = 0x34,
	RT_CHANNEL_DOMAIN_WORLD_ETSI2 = 0x35,
	RT_CHANNEL_DOMAIN_WORLD_ETSI3 = 0x36,
	RT_C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L_DOMAIN_NULL_ETSI18 = 0x70,
	RT_CHANNEL_DOMAIN_NULL_ETSI17 = 0x71,
	RT_CHANNEL_DOMAIN_NULL_ETSI19 = 0x72,
	RT_CHANNEL_DOMAIN_WORLD_FCC7 = 0x73,
	RT_CHANNEL_DOMAIN_FCC2_FCC17 = 0x74,
	RT_CHANNEL_DOMAIN_WORLD_ETSI20 = 0x75,
	RT_CHANNEL_DOMAIN_FCC2_FCC11 = 0x76,
	RT_CHANNEL_DOMAIN_WORLD_ETSI21 = 0x77,
	RT_CHANNEL_DOMAIN_FCC1_FCC18 = 0x78,
	RT_CHANNEL_DOMAIN_MKK2_MKK1 = 0x79,
	RT_CHANNEL_DOMAIN_ETSI1_ETSI25 = 0x7A,
	RT_CHANNEL_DOMAIN_ETSI1_ETSI24 = 0x7B,
	RT_CHANNEL_DOMAIN_ETSI1_ETSI26 = 0x7C,
	RT_CHANNEL_DOMAIN_MKK1_MKK11 = 0x7D,
	RT_CHANNEL_DOMAIN_MKK2_MKK11 = 0x7E,
	RT_CHANNEL_DOMAIN_WORLDWIDE = 0x7F,

	/* ===== Add new channel plan above this line. ===== */
	RT_CHANNEL_DOMAIN_MAX
} RT_CHANNEL_DOMAIN, *PRT_CHANNEL_DOMAIN;

#define BAND_CAP_2G			BIT0
#define BAND_CAP_5G			BIT1

// Scan type including active and passive scan.
typedef enum _RT_SCAN_TYPE {
	SCAN_PASSIVE = 1,
	SCAN_ACTIVE,
} RT_SCAN_TYPE, *PRT_SCAN_TYPE;

enum channel_width {
	CHANNEL_WIDTH_20		= 0,
	CHANNEL_WIDTH_40		= 1,
	CHANNEL_WIDTH_80		= 2,
	CHANNEL_WIDTH_160		= 3,
	CHANNEL_WIDTH_80_80	= 4,
	CHANNEL_WIDTH_5		= 5,
	CHANNEL_WIDTH_10	= 6,
	CHANNEL_WIDTH_MAX	= 7,
};

#define WLANHDR_OFFSET	64
#define TXDESC_OFFSET TXDESC_SIZE

#define WPA_KEY_MGMT_IEEE8021X BIT(0)
#define WPA_KEY_MGMT_PSK BIT(1)
#define WPA_KEY_MGMT_NONE BIT(2)
#define WPA_KEY_MGMT_IEEE8021X_NO_WPA BIT(3)
#define WPA_KEY_MGMT_WPA_NONE BIT(4)
#define WPA_KEY_MGMT_FT_IEEE8021X BIT(5)
#define WPA_KEY_MGMT_FT_PSK BIT(6)
#define WPA_KEY_MGMT_IEEE8021X_SHA256 BIT(7)
#define WPA_KEY_MGMT_PSK_SHA256 BIT(8)
#define WPA_KEY_MGMT_WPS BIT(9)
#define WPA_KEY_MGMT_SAE BIT(10)
#define WPA_KEY_MGMT_FT_SAE BIT(11)
#define WPA_KEY_MGMT_WAPI_PSK BIT(12)
#define WPA_KEY_MGMT_WAPI_CERT BIT(13)
#define WPA_KEY_MGMT_CCKM BIT(14)
#define WPA_KEY_MGMT_OSEN BIT(15)
#define WPA_KEY_MGMT_IEEE8021X_SUITE_B BIT(16)
#define WPA_KEY_MGMT_IEEE8021X_SUITE_B_192 BIT(17)
#define WPA_KEY_MGMT_FILS_SHA256 BIT(18)
#define WPA_KEY_MGMT_FILS_SHA384 BIT(19)
#define WPA_KEY_MGMT_FT_FILS_SHA256 BIT(20)
#define WPA_KEY_MGMT_FT_FILS_SHA384 BIT(21)
#define WPA_KEY_MGMT_OWE BIT(22)
#define WPA_KEY_MGMT_DPP BIT(23)

typedef enum _NDIS_802_11_AUTHENTICATION_MODE {
	Ndis802_11AuthModeOpen,
	Ndis802_11AuthModeShared,
	Ndis802_11AuthModeAutoSwitch,
	Ndis802_11AuthModeWPA,
	Ndis802_11AuthModeWPAPSK,
	Ndis802_11AuthModeWPANone,
	Ndis802_11AuthModeWAPI,
	Ndis802_11AuthModeWPA2,
	Ndis802_11AuthModeWPA2PSK,
	Ndis802_11AuthModeWPA3,
	Ndis802_11AuthModeWPA3PSK,
	Ndis802_11AuthModeMax               // Not a real mode, defined as upper bound
} NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE;

#define MAX_IE_SZ	768 //384//

enum {
	RTW_ROAM_ON_EXPIRED = BIT(0),
	RTW_ROAM_ON_RESUME = BIT(1),
	RTW_ROAM_ACTIVE = BIT(2),
	RTW_ROAM_ON_BTM = BIT(3),
};

/* Extended Capabilities: n bytes */
#define GET_EXT_CAP_MBSSID(_pEleStart)					LE_BITS_TO_1BYTE(((u8 *)(_pEleStart) + 2), 6, 1)
#define SET_EXT_CAP_MBSSID(_pEleStart, _val)				SET_BITS_TO_LE_1BYTE(((u8 *)(_pEleStart) + 2), 6, 1, _val)

enum VCS_TYPE {
	NONE_VCS,
	RTS_CTS,
	CTS_TO_SELF
};

#define WAIT_FOR_BCN_TO_MIN		(6000)
#define WAIT_FOR_BCN_TO_MAX		(20000)

#define A_SHA_DIGEST_LEN		20
#define INFO_ELEMENT_SIZE       128

typedef enum {
	DOT11_PortStatus_Unauthorized,
	DOT11_PortStatus_Authorized,
	DOT11_PortStatus_Guest
} DOT11_PORT_STATUS;

#define _NO_PRIVACY_		0x0
#define _WEP40_				0x1
#define _TKIP_				0x2
#define _TKIP_WTMIC_		0x3
#define _AES_				0x4
#define _WEP104_			0x5
#define _WEP_WPA_MIXED_		0x07  // WEP + WPA
#define _SMS4_				0x06
#define _BIP_				0x8
#define _GCMP_ 0x07
#define _GCMP_256_ (_GCMP_ | BIT(3))
#define _CCMP_256_ (_AES_ | BIT(3))

#define BW_CAP_5M		BIT0
#define BW_CAP_10M		BIT1
#define BW_CAP_20M		BIT2
#define BW_CAP_40M		BIT3
#define BW_CAP_80M		BIT4
#define BW_CAP_160M		BIT5
#define BW_CAP_80_80M	BIT6

enum chan_offset {
	CHAN_OFFSET_NO_EXT = 0,	/*SCN - no secondary channel*/
	CHAN_OFFSET_UPPER = 1,	/*SCA - secondary channel above*/
	CHAN_OFFSET_NO_DEF = 2,	/*Reserved*/
	CHAN_OFFSET_LOWER = 3,	/*SCB - secondary channel below*/
	CHAN_OFFSET_40M_UPPER = 4,
	CHAN_OFFSET_40M_LOWER = 5,
	CHAN_OFFSET_80M_UPPER = 6,
	CHAN_OFFSET_80M_LOWER = 7,
};

typedef enum {
	ENCRYP_PROTOCOL_OPENSYS,   //open system
	ENCRYP_PROTOCOL_WEP,       //WEP
	ENCRYP_PROTOCOL_WPA,       //WPA
	ENCRYP_PROTOCOL_WPA2,      //WPA2
	ENCRYP_PROTOCOL_WPA_WPA2,  //WPA & WPA2
	ENCRYP_PROTOCOL_WAPI,      //WAPI: Not support in this version
	ENCRYP_PROTOCOL_MAX
} ENCRYP_PROTOCOL_E;

/**
 * enum mfp_options - Management frame protection (IEEE 802.11w) options
 */
enum mfp_options {
	NO_MGMT_FRAME_PROTECTION = 0,
	MGMT_FRAME_PROTECTION_OPTIONAL = 1,
	MGMT_FRAME_PROTECTION_REQUIRED = 2,
};
#define MGMT_FRAME_PROTECTION_DEFAULT 3

/* B2-B3: PTKSA Replay Counter */
#define WPA_CAPABILITY_PTKSA(x)	(((u32)((x) & 0x00000003) << 2))
#define WPA_CAPABILITY_MFPR BIT(6)
#define WPA_CAPABILITY_MFPC BIT(7)

enum dot11AuthAlgrthmNum {
	dot11AuthAlgrthm_Open = 0,
	dot11AuthAlgrthm_Shared,
	dot11AuthAlgrthm_8021X,
	dot11AuthAlgrthm_SAE,
	dot11AuthAlgrthm_Auto,
	dot11AuthAlgrthm_WAPI,
	dot11AuthAlgrthm_FT_PSK,
	dot11AuthAlgrthm_MaxNum
};

#define _AUTH_ALGM_NUM_			2
#define _AUTH_SEQ_NUM_			2
#define _BEACON_ITERVAL_		2
#define _CAPABILITY_			2
#define _RSON_CODE_				2
#define _ASOC_ID_				2
#define _STATUS_CODE_			2
#define _TIMESTAMP_				8

/* Values in HE spec */
#define TXOP_DUR_RTS_TH_DISABLED	1023

#define SN_LESS(a, b)		(((a-b)&0x800)!=0)
#define SN_EQUAL(a, b)	(a == b)

#define SHA256_MAC_LEN 32

#define CCK_ONLY_RATE_NUM		4
#define OFDM_ONLY_RATE_NUM		8
#define NumRates			12
#define OFDM_ONLY_BASIC_RATE_NUM	3

/* STA flags */
#define WLAN_STA_AUTH BIT(0)
#define WLAN_STA_ASSOC BIT(1)
#define WLAN_STA_PS BIT(2)
#define WLAN_STA_TIM BIT(3)
#define WLAN_STA_PERM BIT(4)
#define WLAN_STA_AUTHORIZED BIT(5)
#define WLAN_STA_PENDING_POLL BIT(6) /* pending activity poll not ACKed */
#define WLAN_STA_SHORT_PREAMBLE BIT(7)
#define WLAN_STA_PREAUTH BIT(8)
#define WLAN_STA_WME BIT(9)
#define WLAN_STA_MFP BIT(10)
#define WLAN_STA_HT BIT(11)
#define WLAN_STA_WPS BIT(12)
#define WLAN_STA_MAYBE_WPS BIT(13)
#define WLAN_STA_NONERP BIT(31)

#define RTW_RX_HANDLED			2
#define RTW_RFRAME_UNAVAIL		3
#define RTW_RFRAME_PKT_UNAVAIL	4
#define RTW_RBUF_UNAVAIL		5
#define RTW_RBUF_PKT_UNAVAIL	6
#define RTW_SDIO_READ_PORT_FAIL	7

typedef enum _RATEID_IDX_ {
	RATEID_IDX_BGN_40M_2SS = 0,
	RATEID_IDX_BGN_40M_1SS = 1,
	RATEID_IDX_BGN_20M_2SS_BN = 2,
	RATEID_IDX_BGN_20M_1SS_BN = 3,
	RATEID_IDX_GN_N2SS = 4,
	RATEID_IDX_GN_N1SS = 5,
	RATEID_IDX_BG = 6,
	RATEID_IDX_G = 7,
	RATEID_IDX_B = 8,
	RATEID_IDX_VHT_2SS = 9,
	RATEID_IDX_VHT_1SS = 10,
} RATEID_IDX, *PRATEID_IDX;

enum rf_type {
	RF_1T1R			= 0,
	RF_1T2R			= 1,
	RF_2T2R			= 2,
	RF_2T3R			= 3,
	RF_2T4R			= 4,
	RF_3T3R			= 5,
	RF_3T4R			= 6,
	RF_4T4R			= 7,
	RF_TYPE_MAX,
};

enum _IFACE_TYPE {
	IFACE_PORT0, //mapping to port0 for C/D series chips
	IFACE_PORT1, //mapping to port1 for C/D series chip
	IFACE_PORT2,
	MAX_IFACE_PORT,
};

typedef enum _WIRELESS_MODE {
	WIRELESS_MODE_UNKNOWN = 0x00,
	WIRELESS_MODE_A = 0x01,
	WIRELESS_MODE_B = 0x02,
	WIRELESS_MODE_G = 0x04,
	WIRELESS_MODE_AUTO = 0x08,
	WIRELESS_MODE_N_24G = 0x10,
	WIRELESS_MODE_N_5G = 0x20,
	WIRELESS_MODE_AC_5G = 0x40,
	WIRELESS_MODE_AC_24G  = 0x80,
	WIRELESS_MODE_AC_ONLY  = 0x100,
} WIRELESS_MODE;

#define _HW_MSR_STATE_NOLINK_		0x00
#define _HW_MSR_STATE_NAN_		0x01
#define _HW_MSR_STATE_STATION_ 		0x02
#define _HW_MSR_STATE_AP_		0x03
#define _HW_MSR_STATE_MONITOR_		0x04

enum _hw_port {
	HW_PORT0,
	HW_PORT1,
	HW_PORT2,
};

#define CHANNEL_MAX_NUMBER						14	// 14 is the max channel number
#define CHANNEL_MAX_NUMBER_2G					14
#define CHANNEL_MAX_NUMBER_5G					54	// Please refer to "phy_GetChnlGroup8812A" and "Hal_ReadTxPowerInfo8812A"
#define CHANNEL_MAX_NUMBER_5G_80M				7

#define MAX_REGULATION_NUM	TXPWR_LMT_MAX_REGULATION_NUM

#define MAX_2_4G_BANDWITH_NUM					2 // 20M, 40M
#if !defined(CONFIG_80211AC_VHT)
#define MAX_RATE_SECTION_NUM					3 // CCk, OFDM, HT
#define MAX_BASE_NUM_IN_PHY_REG_PG_2_4G			3 //  CCK:1,OFDM:1, HT:1(MCS0_MCS7)
#else
#define MAX_RATE_SECTION_NUM					10
#define MAX_BASE_NUM_IN_PHY_REG_PG_2_4G			10 //  CCK:1,OFDM:1, HT:4, VHT:4
#endif
#define MAX_5G_BANDWITH_NUM						4
#define MAX_BASE_NUM_IN_PHY_REG_PG_5G			9 // OFDM:1, HT:4, VHT:4

enum hal_rate_mode {
	HAL_LEGACY_MODE	= 0,
	HAL_HT_MODE	= 1,
	HAL_VHT_MODE	= 2,
	HAL_HE_MODE	= 3
};

#if !defined(SUPPORT_5G_CHANNEL)
#define TX_PWR_BY_RATE_NUM_BAND			1
#else
#define TX_PWR_BY_RATE_NUM_BAND			2
#endif

#if !defined(CONFIG_80211AC_VHT)
#define RTW_TX_PWR_BY_RATE_NUM_RF			1
#define TX_PWR_BY_RATE_NUM_RATE			20 // CCK 1M~11M, OFDM 6M~54M, MCS0~7
#else
#define RTW_TX_PWR_BY_RATE_NUM_RF			1
#define TX_PWR_BY_RATE_NUM_RATE			30 // CCK 1M~11M, OFDM 6M~54M, MCS0~7, VHT MCS0~MCS9
#endif

#endif //__ROM_RTW_DEFS_H_
